﻿@using Crucible.Models
@model IEnumerable<Crucible.Models.Node>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create new", "Create", null, new { @class = "bevelCorner"})
</p>
<table>
    <col style="width: 400px" />
    <col style="width: 100px" />
    <col style="width: 150px; " />
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AddedBy)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Body)
        </th>
        <th>
            Added
        </th>
        <th>
            Published
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.ActionLink(item.Title, "Details", new { id=item.Id })
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AddedBy.UserName)
            </td>
            <td style="overflow: hidden; display:block; width: 150px; white-space: nowrap; -ms-text-overflow: ellipsis; -o-text-overflow: ellipsis; text-overflow: ellipsis">
                @Html.DisplayFor(modelItem => item.Body)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DateAdded)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Published)
            </td>
            <td>
                @Html.ActionLink("Delete", "Delete", new { id=item.Id })
            </td>
        </tr>
    }

</table>
